﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Deixei;
using Deixei.Common;
using Deixei.Infrastructure;
using Deixei.Web;
using Deixei.Web.Filters;
using Deixei.Domain;
using Microsoft.Practices.Unity;
using Deixei.WebApplication.Controllers;

namespace Deixei.WebApplication
{

    public class MvcApplication : DeixeiHttpApplication
    {
        protected void Application_Start()
        {
            base.Configure();
            DeixeiHttpApplication.Initialise();

            DeixeiHttpApplication.Container.RegisterType<IController, HomeController>("Home");
            DeixeiHttpApplication.Container.RegisterType<IController, AccountController>("Account");

            

            var factory = new UnityControllerFactory(DeixeiHttpApplication.Container);

            ControllerBuilder.Current.SetControllerFactory(factory);

        }
    }
}